package com.sk.bilibili.view.diy.bottomDialog;

import com.sk.bilibili.R;
import com.sk.bilibili.model.diy.bottomDialog.ShareModel;
import com.sk.bilibili.view.activity.DynamicActivity;

public class ShareBottomDialog extends BaseHorizontalBottomDialog<ShareModel>{

    private Integer targetId;
    private Integer type;

    public ShareBottomDialog(Integer type,Integer targetId) {
        this.type=type;
        this.targetId = targetId;
    }

    public Integer getTargetId() {
        return targetId;
    }

    public Integer getType() {
        return type;
    }

    @Override
    protected void afterSetView() {
        title1.setText("转发至站内");
    }

    @Override
    protected void initImageAndName() {
        images1=new int[]{R.drawable.share_dynamic,R.drawable.share_msg};
        names1="动态,消息".split(",");
        images2=new int[]{R.drawable.share_qq,R.drawable.share_qq_space,R.drawable.share_wx,R.drawable.share_wx_space,R.drawable.share_wb,R.drawable.copy_link,R.drawable.more_share};
        names2="QQ,QQ空间,微信,朋友圈,微博,复制链接,更多".split(",");
    }

    @Override
    public void onType1Click(int pos) {
        if (pos == 0) {//动态不支持直播类型
            if(type!=6)DynamicActivity.start(getContext(),type,targetId);
        } else {
            toast("暂不支持");
        }
        dismiss();
    }

    @Override
    public void onType2Click(int pos) {
        switch (pos){
            case 5:
                model.copyUrl();
                toast("已复制到剪切板");
                break;
            case 6:
                model.shareMore();
                break;
            default:
                toast("暂不支持");
                break;
        }
        dismiss();
    }

}